#include <signal.h>
#include <stdio.h>
#include <unistd.h>

/**
 * This program uses the sigaction signal to handle the Cnt-C SIGINT.
 * Note that you'll need to hit Cnt-\ to get out.
 */
void ouch(int sig) {
        printf("OUCH! - I got signal %d\n", sig);
}

int main()
{
        struct sigaction act;
        act.sa_handler = ouch;
        sigemptyset(&act.sa_mask);
        act.sa_flags = 0;

        sigaction(SIGINT, &act, 0);

        while(1) {              /* infinite loop */
                printf("Hello World\n");
                sleep(1);
        }
}
